﻿package plugin.map.ui
{
    import __AS3__.vec.*;
    import com.sh.game.consts.*;
    import com.sh.game.global.*;
    import morn.core.components.*;
    import uiresource.map.*;

    public class WorldPanel extends View
    {
        private var points:Array;
        private var items:Vector.<CityPointUI>;

        public function WorldPanel()
        {
            var _loc_3:Object = null;
            var _loc_4:int = 0;
            var _loc_5:Object = null;
            var _loc_6:Array = null;
            var _loc_7:String = null;
            var _loc_8:Array = null;
            var _loc_9:CityPointUI = null;
            this.points = [0, {新手村:[256, 277]}, {奥玛神殿:[373, 73]}, {赤血洞:[36, 124]}, {热血城:[198, 218]}, {毒蛇山谷:[216, 160]}, {恶灵矿洞:[283, 221]}, {烛玛神殿:[116, 178]}, {蜈蚣洞:[289, 24]}, {土城:[270, 91]}, {冰晶神殿:[470, 96]}, {火龙洞:[470, 170]}, {万劫魔宅:[442, 241]}];
            this.items = new Vector.<CityPointUI>;
            var _loc_1:* = new Image(Config.getUrl("assets/images/minimap/world.jpg", ResourceType.NORMAL));
            this.addChild(_loc_1);
            var _loc_2:* = ConfigDictionary.data.womap;
            for each (_loc_3 in _loc_2)
            {
                
                if (_loc_3)
                {
                    _loc_4 = 0;
                    while (_loc_4 < this.points.length)
                    {
                        
                        _loc_5 = this.points[_loc_4];
                        if (_loc_5.hasOwnProperty(_loc_3.name))
                        {
                            _loc_6 = _loc_5[_loc_3.name];
                            _loc_3.icon = "map" + 1;
                            _loc_7 = _loc_3.xy;
                            _loc_8 = _loc_7.split("#");
                            _loc_3.tox = _loc_8[0];
                            _loc_3.toy = _loc_8[1];
                            _loc_9 = new CityPointUI(_loc_3);
                            _loc_9.x = _loc_6[0];
                            _loc_9.y = _loc_6[1];
                            _loc_9.updatecur();
                            this.items.push(_loc_9);
                            this.addChild(_loc_9);
                            break;
                        }
                        _loc_4++;
                    }
                }
            }
            return;
        }// end function

        public function showItem(param1:String) : void
        {
            var _loc_2:int = 0;
            while (_loc_2 < this.items.length)
            {
                
                if (this.items[_loc_2])
                {
                    if (this.items[_loc_2].data.name != param1)
                    {
                        this.items[_loc_2].closeBtn();
                    }
                }
                _loc_2++;
            }
            return;
        }// end function

        public function show() : void
        {
            var _loc_2:CityPointUI = null;
            var _loc_1:int = 0;
            while (_loc_1 < this.items.length)
            {
                
                _loc_2 = this.items[_loc_1];
                _loc_2.updatecur();
                _loc_1++;
            }
            this.visible = true;
            return;
        }// end function

        public function close() : void
        {
            this.visible = false;
            return;
        }// end function

    }
}
